﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

namespace $safeprojectname$.Web
{
    /// <summary>
    ///     Descriptor for object which will be used as a datasource
    ///     for every row in the ListWC.ascx
    /// </summary>
    public class ItemToDisplay : IItemToDisplay
    {
        #region memebers
        string _backgroundCss = string.Empty;
        string _description = string.Empty;
        bool _canBeUpdated = true;
        bool _canBeDeleted = true;
        #endregion memebers

        #region IItemToDisplay Members
        /// <summary>
        ///     The ID of current Persistent object
        /// </summary>
        public virtual string ID { get; set; }

        /// <summary>
        ///     Collection with all items to be displayed in columns for current row.
        ///     HeaderName and Value are enough. 
        ///     Other settings can be used on UI to render better output ...
        /// </summary>
        public virtual IList<ICellDescription> Items { get; set; }

        /// <summary>
        ///     Item.ToDisplay(); allows display the item description when
        ///     delete confimation dialogue appears
        /// </summary>
        public virtual string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        /// <summary>
        ///     Allows to decorate every row with suitable business-understandable color
        ///     Default is the string.Empty
        /// </summary>
        public virtual string TableRowCss
        {
            get { return _backgroundCss; }
            set { _backgroundCss = value; }
        }

        public virtual bool CanBeEdited
        {
            get { return _canBeUpdated; }
            set { _canBeUpdated = value; }
        }
        public virtual bool CanBeDeleted
        {
            get { return _canBeDeleted; }
            set { _canBeDeleted = value; }
        }
        #endregion
    }
}